home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992…tember: A ROM With a View / devSep92 / devSep92.dmg / Tools & Apps / Networking & Communications / Serial NB Sample Driver / Task / inc / init.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-15  |  1.1 KB  |  59 lines  |  [TEXT/MPS ]

  1. /********************************************************************************/
  2. /*                                                                                */
  3. /*        init.c - Driver initialization.                                            */
  4. /*                                                                                */
  5. /*        Richard W. Mincher.  February 19, 1990.                                    */
  6. /*                                                                                */
  7. /*        Copyright © 1990, Apple Computer, Inc.  All rights reserved.            */
  8. /*                                                                                */
  9. /********************************************************************************/
  10.  
  11. #include    "AROSE.h"
  12. #include    "os.h"
  13. #include    "managers.h"
  14.  
  15. #include    "ARDriver.h"
  16. #include    "ARTask.h"
  17.  
  18. InitTask()
  19. {
  20.     extern    int    _tbeint(), _escint(), _rcaint(), _srcint();
  21.     short        s;
  22.     
  23.     open = 0;
  24.     
  25.     if (Register_Task( PORTNAME, "SCC", 1) == 0)
  26.         return;
  27. #ifdef    DEBUG
  28.     printf("Port %s registered.\n", PORTNAME);
  29. #endif    DEBUG
  30.     
  31.     SaveA5();
  32.     
  33.     s = Spl(7);
  34.     *SCCControl = 0x09;
  35. #ifdef    PORTA
  36.     *SCCControl = 0x80;
  37. #endif
  38. #ifdef    PORTB
  39.     *SCCControl = 0x40;
  40. #endif
  41.  
  42.     *SCCControl = 0x02;
  43. #ifdef    SCC2
  44.     *SCCControl = 0x50;
  45. #endif
  46. #ifdef    SCC1
  47.     *SCCControl = 0x40;
  48. #endif
  49.     (void)Spl(s);
  50.     
  51.     *(long *)(VS_TBE) = _tbeint;
  52.     *(long *)(VS_ESC) = _escint;
  53.     *(long *)(VS_RCA) = _rcaint;
  54.     *(long *)(VS_SRC) = _srcint;
  55.  
  56.     open = 1;
  57. }
  58.  
  59.